<?php
/**
 * Controller de campos para campanhas.
 *
 * @author    Chavão <freela@chavao.net>
 * @copyright Copyright (c) 2011, Chavão
 * @version   0.1
 */

class CampoController extends AppController
{
    /**
     * Controller index
     * @access public
     */
    public function index()
    {
    }

    /**
     * Action adicionar campo
     * @access public
     */
    public function adicionar()
    {
        $this->autoRender = false;
        if(!$this->Usuario->estaLogado()) $this->redirect('/usuario/login');

        $this->data['clie_id'] = $_SESSION['cliente_id'];
        echo ($this->Campo->save($this->data)) ? "{success: true, id: '".$this->Campo->id."'}" : "{success: false}";
    }
}

?>